
from fastapi import FastAPI,Depends

def oauth2_scheme():
    return "123"

def get_current_user(token: str = Depends(oauth2_scheme)):
    # 验证token并获取用户
    print("===========")
    
def get_user_db(user: str = Depends(get_current_user)):
    # 获取与用户关联的特定数据库连接
    print("--------------", user)
    return "ok"
#     return CustomDBConnection(user.id)

# @app.get("/profile")
def user_profile(db = Depends(get_user_db)):
    print("00000  ----> ", db())
    pass

if __name__ == "__main__":
    user_profile()